package liveData.migration.toPhoenix.source;

import org.apache.flink.api.common.serialization.DeserializationSchema;
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer;

import java.util.Properties;

/**
 * @program: userPortrait
 * @description:
 * @author: sunteng
 * @create: 2020-07-10 10:31
 **/
public class KafkaSource {
    public KafkaSource() {
    }

    public static KafkaSource getInstance() {
        return SingleTon.instance;
    }

    private static final class SingleTon {
        private static final KafkaSource instance = new KafkaSource();
    }

    public FlinkKafkaConsumer getKafkaSource(String topic, DeserializationSchema deserializationSchema, Properties properties) {
        return new FlinkKafkaConsumer(topic, deserializationSchema, properties);
    }
}
